/*
 This file is part of BTStracker
		
    BTStracker is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    BTStracker is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Foobar.  If not, see <http://www.gnu.org/licenses/>.	
	author: azbest.pro (azbest.pro@gmail.com)
*/
package pl.vdl.azbest.swt;

import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Display;

import pl.vdl.azbest.mremote.gui.SWTElement;
import pl.vdl.azbest.swt.Composite2.SWTElementInner;

public class Composite1 extends Composite {

	private Label label = null;

	private Group group = null;

	private SWTElementInner swtEi = null;

	public Composite1(Composite parent, int style) {
		super(parent, style);
		swtEi=new SWTElementInner((Shell)parent);
		initialize();
	}
	public Composite1(Composite parent, int style,Shell shell) {
		super(parent, style);
		swtEi=new SWTElementInner(shell);
		initialize();
	}

	private void initialize() {
		GridData gridData = new GridData();
		gridData.horizontalAlignment = GridData.BEGINNING;
		gridData.grabExcessHorizontalSpace = false;
		gridData.grabExcessVerticalSpace = false;
		gridData.verticalAlignment = GridData.CENTER;
		label = new Label(this, SWT.BORDER);
		label.setText("COMPOSITE 1");
		label.setLayoutData(gridData);
		createGroup();
		this.setBackground(new Color(Display.getCurrent(), 212, 180, 200));
		setSize(new Point(300, 200));
		setLayout(new GridLayout());
	}

	/**
	 * This method initializes group
	 * 
	 */
	private void createGroup() {
		GridData gridData1 = new GridData();
		gridData1.horizontalAlignment = GridData.CENTER;
		gridData1.grabExcessVerticalSpace = false;
		gridData1.grabExcessHorizontalSpace = false;
		gridData1.widthHint = 250;
		gridData1.heightHint = 90;
		gridData1.verticalAlignment = GridData.CENTER;
		group = new Group(this, SWT.NONE);
		group.setLayout(new GridLayout());
		group.setText("Group 1");
		group.setLayoutData(gridData1);
	}

	class SWTElementInner extends SWTElement {
		SWTElementInner(Shell s) {
			this.sShell = s;
		}

		protected void createSShell() {
		}
	}

}
